package com.snowy.hidden.constant;

import lombok.Getter;

import java.util.Arrays;

/**
 * <p>
 * 交易中心-审批状态 枚举类
 * 待审核、审核通过、审核不通过
 * </p>
 *
 * @author：Lei.y
 * @date：2022/5/11 15:42
 */
@Getter
public enum HiddenLevelEnum {
    RED(1,"严重"),
    YELLOW(2,"主要"),
    BLUE(3,"次要"),
    SEYR(4,"轻微"),
    ;

    private Integer code;
    private String desc;

    HiddenLevelEnum(Integer code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    /**
     * 通过code获取枚举
     *
     * @param code
     * @return
     */
    public static HiddenLevelEnum getEnum(Integer code) {
        return Arrays.stream(HiddenLevelEnum.values()).filter(item -> item.getCode().equals(code)).findFirst().get();
    }
}
